-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add Rosetta Simulator Instructions #4599
base: master
Are you sure you want to change the base?
Conversation
Thanks a lot, @kagrawal98! Are you and @differenzPriv aligned on the solution? |
In any case, you seem to have edited the document in the wrong path. Should be easy to fix. |
Thanks @d4vidi for tagging me and keeping me in the loop! I haven't forgotten to contribute to the repository in relation to the rosetta trouble shooting solution, but my time has been quite limited over the past few weeks. I agree with the addition @kagrawal98 made to the README. The solution includes all the key elements needed to solve the problem. 👍🏻 |
@differenzPriv thanks, that's what I needed to know |
@kagrawal98, you've edited the snapshotted version of |
2. Run the following command in your terminal to ensure Xcode is properly selected: | ||
|
||
```bash | ||
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer | |
sudo xcode-select --switch /Applications/Xcode.app |
No need for the full path
2. Run the following command in your terminal to ensure Xcode is properly selected: | ||
|
||
```bash | ||
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we can assume they already have it configured. You only need to configure xcode-select -s
when you have more than one version of Xcode installed on your system and you want to switch between them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this step since it's not unique for Rosetta env
1. Modify your build command in the Detox configuration: | ||
|
||
```json | ||
"build": "xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example is not enough, please emphasize that it's done by specifying arch=x86_64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asafkorem Setting it via the build settings might lead to conflicts with the necessary configuration for the app. In my project, for instance, I need specific build settings due to different dependencies. My goal is to adjust the architecture specifically for running the Detox tests, without altering the overall app build. That's why I chose to modify only the Detox build command. I want to emphasize that this is about changing Detox’s behavior, not my app’s – a crucial distinction!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@differenzPriv True, I get your point. If your app can run in the Rosetta environment on Apple Silicon without Detox, then Detox is the only concern here, and your approach makes perfect sense. However, if that's not the case, it would be reasonable to add this architecture under the Debug configuration in Xcode. It might be worth mentioning this distinction in the doc IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Xcode, you can enable "Show All Simulators". Here, we select the Rosetta simulator for the normal build. In the "Excluded Architectures" tab, we select the "arm64" architecture, not "x86_64". So, in my case, I only need to change the architecture for the "detox-build-command" and not the general one.
I like your suggestion to mention this distinction for better understanding and for choosing the right solution for a specific use case. 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense @differenzPriv.
@kagrawal98 can you add this note?
Description
Fixes #4571
This PR adds a new section to the "Building the App" troubleshooting guide, specifically addressing issues that may arise when running Detox in a Rosetta environment on Apple Silicon Macs.
Why is this important?
As more developers transition to Apple Silicon Macs, it's crucial to provide guidance on running tools like Detox in Rosetta environments. This addition will help users troubleshoot and resolve common issues, improving their development experience.